package com.lyq;


import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;

public class Win {

    public static void main(String[] args) {

        ArrayList<ArrayList> mywin = new ArrayList<>();
        for (int i = 0; i < 1000000; i++) {
            mywin.add(myLucy());
        }

        for (int i = 0; i < 5; i++) {
            int winwinwin = (int) (Math.random() * 10000);
//            System.out.println(winwinwin);
            System.out.println(mywin.get(winwinwin));
        }


    }


    public static ArrayList myLucy() {
        ArrayList<Integer> winList = new ArrayList<>(7);

        int[] winRedCode = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
                11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
                21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33};

        int[] winBlueCode = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
                11, 12, 13, 14, 15, 16};

//        int winRed = (int) (Math.random() * winRedCode.length);
//        int winBlue = (int) (Math.random() * winBlueCode.length);
//
//
//        int LucyRedCoed= winRedCode[winRed];
//        int LucyBlueCoed= winRedCode[winBlue];


        while (winList.size() < 7) {
            int winRed = (int) (Math.random() * winRedCode.length)+1;
            if (!winList.contains(winRed)){
                winList.add(winRed);
            }
            while (winList.size() == 6) {
                Collections.sort(winList);
                int winBlue = (int) (Math.random() * winBlueCode.length)+1;
                winList.add(winBlue);
            }
        }

        return winList;
    }
}






